import {request, config} from 'utils'
import axios from 'axios'
import FileSaver from 'file-saver'

const {api} = config
const {products,shop} = api

//商品列表
export async function query(queryParam) {
  const url = `${products}/list4Bind`
  return request({url: url, method: 'post', data: queryParam})
}

//商品类目列表
export async function queryClassifyList() {
  const url = `${products}/classify/list`
  return request({url: url, method: 'get', data: {}})
}

// 添加购物车
export async function addToCart(queryParam) {
  const url = `${shop}/cart/create`
  return request({url: url, method: 'post', data: queryParam})
}

// 购物车内商品数量
export async function queryCartCount({distributorId}) {
  const url = `${shop}/cart/count/${distributorId}`
  return request({url: url, method: 'get', data: {}})
}


